package org.xxpay.core.service;

import com.alibaba.fastjson.JSONObject;
import org.xxpay.core.entity.StatisticsPlat;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 平台统计表 服务类
 * </p>
 *
 * @author xxpay generator
 * @since 2021-02-26
 */
public interface IStatisticsPlatService {

    List<StatisticsPlat> select(int pageIndex, int pageSize, StatisticsPlat statisticsPlat, JSONObject queryObj);

    List<StatisticsPlat> select2(int pageIndex, int pageSize, StatisticsPlat statisticsPlat, Date createTimeStart, Date createTimeEnd);

    long count(StatisticsPlat statisticsPlat, JSONObject queryObj);

    long count2(StatisticsPlat statisticsPlat, Date createTimeStart, Date createTimeEnd);

    int add(StatisticsPlat statisticsPlat);

    int updateByPrimaryKey(StatisticsPlat statisticsPlat);

    StatisticsPlat findByPrimaryKey(Date statisticsDate);

    /**
     * 平台数据汇总
     * @return
     */
    Map countAll();

    /**
     * 支付订单统计数据
     * @param mchId
     * @param payPassageAccountId
     * @param payPassageId
     * @param list
     * @param statisticsDateStart
     * @param statisticsDateEnd
     * @return
     */
    JSONObject payCorrect(Long mchId, Integer payPassageAccountId, Integer payPassageId, List<Byte> list, String statisticsDateStart, String statisticsDateEnd);

    /**
     * 代付订单统计数据
     * @param mchId
     * @param status
     * @param statisticsDateStart
     * @param statisticsDateEnd
     * @return
     */
    JSONObject agentpayCorrect(Long mchId, Byte status, String statisticsDateStart, String statisticsDateEnd);

    /**
     * 成功的充值数据统计
     * @param mchId
     * @param statisticsDateStart
     * @param statisticsDateEnd
     * @return
     */
    JSONObject rechargeCorrectSuccess(Long mchId, String statisticsDateStart, String statisticsDateEnd);

    int updateStatistics(StatisticsPlat updateRecord);
}
